home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -serious- / misc / cmq060 / source / cmq060.s < prev    next >
Text File  |  1999-07-26  |  2KB  |  78 lines

  1. *******************************************
  2. *            CopyMemQuicker060            *
  3. * Uses Move16 only in Adresses >$00ffffff *
  4. *                                         *
  5. *            Install File V1.4            *
  6. *          written by Dirk Busse          *
  7. *               3. Apr. 1999              *
  8. *******************************************
  9.  
  10.    MACHINE 68060
  11.  
  12.    INCDIR   include:
  13.  
  14.    include  exec/execbase.i
  15.    include  exec/memory.i
  16.    include  dos/dos.i
  17.    include  LVO.i
  18.  
  19. PatchLen    equ PatchEnd-PatchStart
  20.  
  21. *=========================================================================
  22.  
  23.  
  24.       movea.l  4.w,a6
  25.  
  26.    ;------ Check for 68040 or 68060
  27.  
  28.       btst     #3,AttnFlags+1(a6)
  29.       bne.b    MC040or060          ; No 68040 or 68060 ...
  30. Fail  moveq    #RETURN_FAIL,d0
  31.       rts
  32.  
  33. MC040or060
  34.  
  35.    ;------ Allocate a buffer to store the patches.
  36.  
  37.       move.l   #PatchLen+15,d0
  38.       moveq    #MEMF_PUBLIC,d1
  39.       jsr      _LVOAllocMem(a6)
  40.       move.l   d0,d6
  41.       beq.b    Fail                ; No memory available
  42.  
  43.    ;------ Copy our patches in the buffer.
  44.  
  45.       addi     #15,d6
  46.       andi.b   #%11110000,d6       ; Now we have an address modulo 16
  47.       lea      PatchStart(pc),a0
  48.       movea.l  d6,a1
  49.       move.l   #PatchLen,d0
  50.       jsr      Quickest            ; The new CopyMemQuicker
  51.  
  52.    ;------ Install the patches.
  53.  
  54.       movea.l  a6,a1               ; ExecBase to a1
  55.       lea      (_LVOCopyMem).w,a0  ; funcOffset to a0
  56.       move.l   d6,d0               ; New Address to d0
  57.       jsr      _LVOSetFunction(a6)
  58.  
  59.       movea.l  a6,a1
  60.       lea      (_LVOCopyMemQuick).w,a0
  61.       move.l   d6,d0
  62.       addi.l   #Quickest-PatchStart,d0
  63.       jsr      _LVOSetFunction(a6)
  64.  
  65.       moveq    #RETURN_OK,d0     ; That's all.
  66.       rts
  67.  
  68.       dc.b     "$VER: CMQ060 1.4 (3.4.99)",0
  69.  
  70.   cnop 0,8
  71.  
  72. *=========================================================================
  73.  
  74.    include     CMQ060.Include.s
  75.  
  76. *=========================================================================
  77.  
  78.